#include<stdio.h>

int char_count(char c, char *str){
    int count = 0;
    while(*str != '\0'){
	if(*str == c){
           count++;
	}
	str++;
    }
    return count;
}
int main(){
    char str[100];
    char c;
    printf("输入一个字符串和一个字符，用空格隔开\n");
    scanf("%s %c", str, &c);
    printf("%d\n", char_count(c, str));
    return 0;
}
